import {http} from '@/utils/http'
import type {Employee} from '@/types/employee'
import type {PageParams} from '@/utils/http/types'

export const deleteEmployees = (ids: number[]) => {
  return http.delete('/contract/employee', ids)
}

export const updateEmployee = (data: Employee) => {
  return http.put('/contract/employee', data)
}

export const getEmployee = (id: number) => {
  return http.get<Required<Employee>>(`/contract/employee/${id}`)
}

export const saveEmployee = (data: Employee) => {
  return http.post('/contract/employee', data)
}

export const listEmployees = (pageParams?: PageParams, employee?: Partial<Employee>) => {
  return http.listPage<Required<Employee>>('/contract/employee', pageParams, employee)
}
